#include "net_pre.h"
#include "server_adapter.h"

#include "app_base.h"
#include "cmd_line_configer.h"

namespace Net
{
	AppBase* ServerAdapter::AdaptAppServer(int argc, _TCHAR* argv[])
	{
		CmdLineConfiger configer;
		if (!configer.Init(argc, argv))
			return NULL;

		AppBase* app_base = NULL;
		if (configer.get_bool("login"))
			app_base = new AppBase;
		else if (configer.get_bool("gate"))
			app_base = new AppBase;
		else if (configer.get_bool("world"))
			app_base = new AppBase;
		else if (configer.get_bool("zone"))
			app_base = new AppBase;

		if ( !app_base )
			return NULL;

		app_base->AssignCmdLineConfiger(configer);
		return app_base;
	}
}